package com.iwhalecloud.citybrain.flow.platform.manager.application.service.impl;

import java.util.List;

import org.flowable.engine.impl.RuntimeServiceImpl;
import org.flowable.engine.impl.runtime.ChangeActivityStateBuilderImpl;
import org.flowable.engine.runtime.ChangeActivityStateBuilder;

/**
 * @author lilh
 * @date 2019-07-10 13:35
 */
public class CustomChangeActivityStateBuilderImpl extends ChangeActivityStateBuilderImpl {

    public CustomChangeActivityStateBuilderImpl(RuntimeServiceImpl runtimeService) {
        super(runtimeService);
    }

    public ChangeActivityStateBuilder moveActivityIdsToSingleActivityIds(List<String> activityIds, List<String> moveToActivityIds) {
        moveActivityIdList.add(new CustomMoveActivityIdContainer(activityIds, moveToActivityIds));
        return this;
    }

    public class CustomMoveActivityIdContainer extends MoveActivityIdContainer {

        public CustomMoveActivityIdContainer(String singleActivityId, String moveToActivityId) {
            super(singleActivityId, moveToActivityId);
        }

        public CustomMoveActivityIdContainer(List<String> activityIds, String moveToActivityId) {
            super(activityIds, moveToActivityId);
        }

        public CustomMoveActivityIdContainer(String singleActivityId, List<String> moveToActivityIds) {
            super(singleActivityId, moveToActivityIds);
        }

        public CustomMoveActivityIdContainer(List<String> activityIds, List<String> moveToActivityIds) {
            super(activityIds, null);
            this.activityIds = activityIds;
            this.moveToActivityIds  = moveToActivityIds;
        }

    }
}
